let come_top = document.querySelector('.come_top') //获取回到顶部
console.log(come_top);
// 给 回到顶部添加监听鼠标滚动事件
come_top.onclick = function () {
    var timer = setInterval(function () {
        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
        scrollTop = scrollTop - 70
        document.documentElement.scrollTop = document.body.scrollTop = scrollTop;
        if (scrollTop <= 0) {
            clearInterval(timer)
        }
    }, 50)
}
window.onscroll = function () {
    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
    if (scrollTop > 100) {
        console.log(2)
        come_top.style.display = "block";
    } else {
        come_top.style.display = "none";
    }
}